package com.test.aes.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.test.aes.mapper.SysUserMapper;
import com.test.aes.pojo.SysUser;
import com.test.aes.service.SysUserService;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.Map;

/**
 * @author LuYanYu
 * @version 1.0
 * @date 2022/12/1 17:23
 */
@Service
public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> implements SysUserService {
    @Override
    public Map<String, Object> saveUserInfo(SysUser sysUser) {
        Map<String, Object> resultMap = new HashMap<>(1);
        int insert = baseMapper.insert(sysUser);
        resultMap.put("code",insert);
        return resultMap;
    }

    @Override
    public Map<String, Object> getUserInfo(Integer id) {
        Map<String, Object> resultMap = new HashMap<>(1);
        resultMap.put("data",baseMapper.selectById(id));
        return resultMap;
    }

    @Override
    public Map<String, Object> updateUserInfo(SysUser sysUser) {
        Map<String, Object> resultMap = new HashMap<>(1);
        resultMap.put("data",baseMapper.updateById(sysUser));
        return resultMap;
    }
}
